package com.zdxlz.fcmp.business.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zdxlz.fcmp.common.mybatis.base.BaseEntity;
import com.zdxlz.fcmp.common.mybatis.enums.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import static com.zdxlz.fcmp.common.core.constant.ParameterVerifyMsgConstants.*;

/**
 * <p>
 * IPSec模板配置表
 * </p>
 *
 * @author: aman
 * @since 2025-02-08
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("ipsec_vpn_template_config")
public class IpsecVpnTemplateConfigEntity extends BaseEntity {

    /**
     * 模板名称
     */
    @NotBlank(message = VPN_TEMPLATE_NAME_VERIFY_MSG)
    @TableField("name")
    private String name;

    /**
     * 1: Site-to-Site 2: PC-to-Site，枚举类：IpsecTypeEnum
     */
    @TableField("ipsec_type")
    private IpsecTypeEnum ipsecType;

    /**
     * (1:隧道模式； 2：传输模式)，枚举类：EncapsulationModeEnum
     */
    @TableField("encapsulation_mode")
    private EncapsulationModeEnum encapsulationMode;

    /**
     * IKE验证方法(PreShareKey/X509)，枚举类：IkeVerifyMethodEnum
     */
    @TableField("ike_verify_method")
    private IkeVerifyMethodEnum ikeVerifyMethod;

    /**
     * IKE验证算法,（MD5/SHA1/SHA256）默认SHA1，枚举类：IkeVerifyAlgorithmEnum
     */
    @TableField("ike_verify_algorithm")
    private IkeVerifyAlgorithmEnum ikeVerifyAlgorithm;

    /**
     * IKE加密算法,（DES/3DES/AES128/AES192/AES256），枚举类：IkeEncryptAlgorithmEnum
     */
    @TableField("ike_encrypt_algorithm")
    private IkeEncryptAlgorithmEnum ikeEncryptAlgorithm;

    /**
     * IKE组参数,(none/group1/ group2/ group5/ group14)，枚举类：IkedhGroupEnum
     */
    @TableField("ikedh_group")
    private IkedhGroupEnum ikedhGroup;

    /**
     * IKE身份类型
     */
    @TableField("ike_type")
    private int ikeType;

    /**
     * IPSec认证算法（MD5/SHA1/SHA256），枚举类：IpsecAuthAlgorithmEnum
     */
    @TableField("ipsec_auth_algorithm")
    private IpsecAuthAlgorithmEnum ipsecAuthAlgorithm;

    /**
     * IPSec加密算法,(3DES /AES128 /AES192/ AES256)，枚举类：IpsecEncryptAlgorithmEnum
     */
    @TableField("ipsec_encrypt_algorithm")
    private IpsecEncryptAlgorithmEnum ipsecEncryptAlgorithm;

    /**
     * IPSecDH组(none/group1/ group2/ group5/group14/group19/group20/group21)，枚举类：IpsecPfsEnum
     */
    @TableField("ipsec_pfs")
    private IpsecPfsEnum ipsecPfs;

    /**
     * IPSecSA流量生命周期,单位秒
     */
    @TableField("ipsec_satraffic_period")
    private Integer ipsecSatrafficPeriod;

    /**
     * AH认证算法,（MD5/SHA1/SHA256），枚举类：AhAuthAlgorithmEnum
     */
    @TableField("ah_auth_algorithm")
    private AhAuthAlgorithmEnum ahAuthAlgorithm;

    /**
     * IPSec封包协议（AH/ESP），枚举类：IpsecTransformEnum
     */
    @NotNull(message = IPSECTRANSFORM_VERIFY_MSG)
    @TableField("ipsec_transform")
    private IpsecTransformEnum ipsecTransform;

    /**
     * IKESA时间生命周期
     */
    @NotNull(message = IKESAPERIOD_VERIFY_MSG)
    @TableField("ike_saperiod")
    private Integer ikeSaperiod;

    /**
     * IPESCSA生命周期, 单位秒
     */
    @NotNull(message = IPSECSATIMEPERIOD_VERIFY_MSG)
    @TableField("ipsec_satime_period")
    private Integer ipsecSatimePeriod;

    /**
     * 使能DPD(false：去使能 true：使能)
     */
    @NotNull(message = DPDENABLE_VERIFY_MSG)
    @TableField("dpd_enable")
    private Boolean dpdEnable;

    /**
     * DPD重传间隔,单位秒
     */
    @NotNull(message = DPDDPDRETRY_VERIFY_MSG)
    @TableField("dpd_dpdretry")
    private Integer dpdDpdretry;

    /**
     * DPD空闲时间（单位秒）（DPD重传间隔 * DPD空闲时间）
     */
    @NotNull(message = DPDTHRESHOLD_VERIFY_MSG)
    @TableField("dpd_threshold")
    private Integer dpdThreshold;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;
}
